package com.lechi.web.service.impl;

import com.lechi.web.service.IIotUpgradeLogService;
import com.lechi.web.system.domain.IotUpgradeLog;
import com.lechi.web.system.mapper.iot.IotUpgradeLogMapper;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * 升级日志记录Service业务层处理
 *
 * @author yangguang
 * @date 2024 -07-10
 */
@Service
@RequiredArgsConstructor
public class IotUpgradeLogServiceImpl implements IIotUpgradeLogService {

    private final IotUpgradeLogMapper iotUpgradeLogMapper;

    /**
     * 查询升级日志记录
     *
     * @param id 升级日志记录主键
     */
    @Override
    public IotUpgradeLog selectIotUpgradeLogById(Long id) {
        return iotUpgradeLogMapper.selectIotUpgradeLogById(id);
    }

    /**
     * 查询升级日志记录列表
     *
     * @param iotUpgradeLog 升级日志记录
     * @return 升级日志记录
     */
    @Override
    public List<IotUpgradeLog> selectIotUpgradeLogList(IotUpgradeLog iotUpgradeLog) {
        return iotUpgradeLogMapper.selectIotUpgradeLogList(iotUpgradeLog);
    }

    /**
     * 新增升级日志记录
     *
     * @param iotUpgradeLog 升级日志记录
     */
    @Override
    public void insertIotUpgradeLog(IotUpgradeLog iotUpgradeLog) {
        iotUpgradeLog.setCreateTime(new Date());
        iotUpgradeLogMapper.insertIotUpgradeLog(iotUpgradeLog);
    }

    /**
     * 修改升级日志记录
     *
     * @param iotUpgradeLog 升级日志记录
     */
    @Override
    public void updateIotUpgradeLog(IotUpgradeLog iotUpgradeLog) {
        iotUpgradeLogMapper.updateIotUpgradeLog(iotUpgradeLog);
    }

}
